package com.yinhai.util;

public class GetTimeLength {
	public static String getTimeLength(String tt){
		String timeStr = "";
		//String t = String.valueOf(tt);
		//String t = tt.substring(0, tt.length()-3);
		int time = Integer.parseInt(tt);  
        int hour = 0;  
        int minute = 0;  
        int second = 0;  
        if (time <= 0)  
            return "00:00";  
        else {  
            minute = time / 60;  
            if (minute < 60) {  
                second = time % 60;  
                if(minute==0){
                	if(second>9){
                		timeStr =  "00:00:"+second+""; 
                	}else{
                		timeStr =  "00:00:0"+second+""; 
                	}
                	 
                }else{
                	if(minute>9){
                		if(second>9){
                			timeStr = "00:"+minute + ":" + second;
                		}else{
                			timeStr = "00:"+minute + ":0" + second;
                		}
                	}else{
                		if(second>9){
                			timeStr = "00:0"+minute + ":" + second;
                		}else{
                			timeStr = "00:0"+minute + ":0" + second;
                		}
                	}
                	 
                }
                
            } else {  
                hour = minute / 60;  
                if (hour > 99)  
                    return "99:59:59";  
                minute = minute % 60;  
                second = time - hour * 3600 - minute * 60;  
                timeStr = " " + minute + "'" + second+"\"";  
            }  
        }  
        return timeStr;
	}
}
